// 业务管理
import NewsManage from './newsManage'; // 新闻管理
import MessageManage from './messageManage'; // 消息管理

import NotFound from '@/views/404/index.vue';
import CommitHistory from '@/views/404/logs.vue';

export const routes = [
  {
    path: 'biz',
    redirect: '/biz/home',
    meta: meta('业务管理'),
    children: [...NewsManage, ...MessageManage],
  },
  {
    path: 'logs',
    name: 'logs',
    meta: meta('更新历史'),
    component: CommitHistory,
  },
  // 其他路由配置
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: NotFound,
  },
];

//menu配置
export function meta(title, icon = null, isDirectory = false, isShow = true) {
  return {
    title,
    icon,
    isDirectory, // 是否为父级菜单
    isShow, // 是否显示
  };
}
